﻿using System;
using System.Collections.Generic;
using System.Text;
using ORM.Annotations;

namespace Domain.Commons
{
    public interface Identifer
    {
        string Id
        {
            get;
            set;
        }
    }

    public interface ICodeName
    {
        string Code
        {
            get;
            set;
        }

        string Name
        {
            get;
            set;
        }
    }

    public abstract class DomainObject : Identifer, ICodeName
    {
        [EntityFeild("Id", Id = true, Title = "主键Id")]
        public string Id { get; set; }

        [EntityFeild("Code", Title = "编码")]
        public string Code { get; set; }

        [EntityFeild("Name", Title = "名称")]
        public string Name { get; set; }

        public override string ToString()
        {
            return new StringBuilder().Append("Id : " + Id).Append("\tCode : " + Code).Append("\tName : " + Name).ToString();
        }
    }

    public interface ICreateInfo
    {
        string CreateUserId
        {
            get;
        }

        DateTime CreateDate
        {
            get;
        }

        string UpdateUserId
        {
            get;
        }

        DateTime UpdateDate
        {
            get;
        }
    }
}
